<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<link href="images/main.css" rel="stylesheet" type="text/css" />
<link  href="../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../js/trim.js"></script>
<script language="javascript" type="text/javascript" src="../My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript">
	/* function validate(userfield) {
		if (trim(userfield.value).length != 0) {
			var xmlHttpRequest = null;
			var url = "../YaoNameIsExistServlet?mname=" + userfield.value;
			var usermsg = document.getElementById("usermsg");
			if (window.XMLHttpRequest) {//表示当前浏览器不是IE
				xmlHttpRequest = new XMLHttpRequest();
			} else if (window.ActiveXObject) {
				xmlHttpRequest = new ActiveXObject("Microsoft.XMLHTTP");
			}
			xmlHttpRequest.open("GET", url, true);//设置请求方式为GET，设置请求的URL，设置为异步提交
			xmlHttpRequest.onreadystatechange = function(){//将方法地址复制给onreadystatechange属性
				if(xmlHttpRequest.readyState == 4){//Ajax引擎状态为成功
					if(xmlHttpRequest.status == 200){//HTTP协议状态为成功
						if(trim(xmlHttpRequest.responseText) != ""){
							usermsg.innerHTML = "<font color='red'>" + trim(xmlHttpRequest.responseText) + "</font>";
							userfield.focus();
						}else{
							usermsg.innerHTML = "药物名称尚未添加使用。 ";
						}
					}else{
						alert("请求失败，错误码=" + xmlHttp.status);
					}
				}
			};
			xmlHttpRequest.send(null);//将设置信息发送到Ajax引擎
		}else{
			usermsg.innerHTML = "";
		}
	} */
	function sub(){
		var mname = document.getElementById("drugstroge");
		if(trim(drugstroge.value).length == 0){
			alert("仓库名称不能为空。");
			mname.focus();
		}else{
			document.forms["form"].submit();
		}
	}
</script>
</head>
<body onload="init();">
	<jsp:include page="right_top.jsp"></jsp:include>
	<!-- TOP START -->
	<div id="right_font">
		<img src="images/main_14.gif" /> 您现在所在的位置：首页 → 药物基础管理 → <span
			class="bfont">添加仓库名称</span>
	</div>
	<!-- TOP END -->
	<hr >
	<form action="MedicineContorlServlet?method=add" method="post" name="form" id="form">
		<table style="margin-top: 30px;">
			<tr height="30px;">
				<td><font color="#FF0000">*</font>仓库名称：</td>
				<td><input type="text" name="drugstroge" id="drugstroge" maxlength="12" onblur="validate(this)"/></td>
				<td width="220px;"><span id="usermsg"></span></td>
			</tr>
			<tr height="30px;">
				<td colspan="2" align="center">
					&nbsp;
				</td>
				<td>&nbsp;</td>
			</tr>
			<tr height="30px;">
				<td colspan="2" align="center">
					<input type="button" value="提交" onclick="sub();"/>&nbsp;&nbsp;
					<input type="button" value="返回" onclick="history.go(-1);" />
				</td>
				<td>&nbsp;</td>
			</tr>
		</table>
	</form>
</body>
</html>